/*
 * @Author: huangyq
 * @Date: 2022-04-20 15:50:45
 * @LastEditTime: 2022-06-14 14:14:33
 * @LastEditors: huangyq
 * @Description: your description
 * @FilePath: /vue3-boilerplate-pc-client/src/apis/portal/LoginApi.ts
 */
import { IBaseRequest, IBaseResponse, AxiosPromise } from '@/plugins/httpHelper'
import PortalApi from './PortalApi'

export default class LoginApi extends PortalApi {
  static path = super.$basePath + '/'

  /**
   * @summary 登录
   */
  static loginUsingPOST = (
    params: IBaseRequest
  ): AxiosPromise<IBaseResponse> => {
    // return super.basePostRequest(this.path + '/login', params)
    return Promise.resolve({
      data: {
        success: true,
        token: '123',
        params
      }
    }) as AxiosPromise
  }

  /**
   * @summary 登出
   */
  static logoutUsingPOST = (
    params: IBaseRequest
  ): AxiosPromise<IBaseResponse> => {
    return super.basePostRequest(this.path + '/logout', params)
  }

  /**
   * @summary 验证码
   */
  static verifyCodeUsingPOST = (
    params: IBaseRequest
  ): AxiosPromise<IBaseResponse> => {
    return Promise.resolve({
      data: {
        success: true,
        params
      }
    }) as AxiosPromise
    // return super.basePostRequest(this.path + '/verify-code', params)
  }
}
